function showPaymentFee() {
   $("#rechargeAmount").val($("#rechargeAmount").val().replace(/\D+/g, ''));
   $("#chineseMoney").html(changeMoneyToChinese($("#rechargeAmount").val()));
}

$(function(){
	$('#recharge_form').submit(function(){
		var bank_id = $('#recharge_form input[name="bank_id"]:checked').val();
		if(!bank_id){
			//alert('请选择银行!');
			$.alert({
	    		status : 'error',
				basicTitle : '请选择银行!'
			});
			return false;
		}
		var amount = $('#recharge_form input[name="amount"]');
		if(amount.val() == ""){
			//alert('请输入充值金额!');
			$.alert({
	    		status : 'error',
				basicTitle : '请输入充值金额!'
			});
			return false;
		}
		if(!$.check.isMoney(amount.val()))
		{
			$.alert({
	    		status : 'error',
				basicTitle : '请输入正确的充值金额!'
			});
			return false;
		}
		var aval = parseInt(amount.val());
		if(aval < parseInt(amount.attr('min')) || aval > parseInt(amount.attr('max'))){
			//alert('单笔充值限额 最低： 1 元，最高： 100000 元 !');
			$.alert({
	    		status : 'error',
				basicTitle : $.substitute('单笔充值限额 最低： {min} 元，最高： {max} 元 !',{min:amount.attr('min'),max:amount.attr('max')})
			});
			return false;
		}
		var onlinePayment=$('#recharge_form input[name="bank_id"]:checked').attr("onlinePayment");
		$.ajax({
			url 	: window.frontPath + "bank/recharge_submit",
			method 	: 'POST',
			data    : {
				bank_id: bank_id,
				amount: aval,
				onlinePayment:onlinePayment
			},
			success : function(data){
				if(onlinePayment == "Y"){ 
					location.href=window.frontPath + 'home#/bank/online_recharge/'+data.id;
				}else{
					location.href=window.frontPath + 'home#/bank/recharge_submit/'+data.id;
				}
			}
		});
		return false;
	});
	$.placeholder.init();
});